﻿@model Umbraco.Cms.Web.Model.BackOffice.TinyMCE.InsertMacro.SelectMacroModel
@using Umbraco.Framework.Persistence.Model.Constants;
@{
    Layout = "../Shared/_ModalLayout.cshtml";

    Html
        .RequiresJs("Umbraco.Editors/Dialogs/InsertMacroEditor/SelectMacro.js", "Scripts");
}
@section Head {
    <script type="text/javascript">
        (function ($) {
            $(document).ready(function () {
                Umbraco.Editors.InsertMacroEditor.SelectMacro.getInstance().init();
            });
        })(jQuery);
    </script>
}

@using (Html.BeginForm("SetParameters", "InsertMacroEditor", FormMethod.Get))
{
	<h2>Select Macro</h2>

    <div class="property-pane">        
        @Html.UmbEditorFor(x => Model.MacroAlias, x => Model.MacroAlias,
            Html.DropDownListFor(x => Model.MacroAlias, Model.AvailableMacroItems, "Choose...",
                         new Dictionary<string, object> { { "data-bind", "value: macroAlias" } }))
    </div>    	

    <div class="button-bar">
        <input type="submit" value="Next >" data-bind="enable: macroAlias" /> or <a href="#" data-bind="click: cancel">Cancel</a>
    </div>
    
}